Skip to content

test: the diff page mounts whole against a stubbed fetch - #76

Merged
fiddur merged 3 commits into
developfrom
diff-page-smoke
Sep 1, 2026
Merged

test: the diff page mounts whole against a stubbed fetch#76
fiddur merged 3 commits into
developfrom
diff-page-smoke

Conversation

@fiddur

@fiddur fiddur commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Closes #48.

diff-page.tsx orchestrates threads, live status, tours, presence and the diff, and nothing rendered it in a test — three wiring regressions in a month would each have failed a stubbed-fetch mount.

  • diff-page-smoke.test.tsx mounts the whole page under a memory router (loader-provided ref/theme/view) and a query client, with one stubbed fetch answering /api/info, /api/diff (a real diff through parseDiff), /api/threads, /api/live/status, /api/tours and the viewer beacon. It asserts the changed file and its word-diffed line render, the anchored finding is visible, the general-comments surface and view-switch buttons exist — and that an empty diff says so.
  • jsdom lays nothing out, so the test gives the page a fixed 800×1200 world via offsetWidth/offsetHeight (what @tanstack/virtual-core actually reads) plus a rect mock; shiki is mocked to its pre-load null state, which the page renders plainly anyway.
  • Ride-along: packages/ui/pnpm-lock.yaml — a stale pnpm lockfile committed long ago upstream in this npm monorepo — is removed.

Version bump 0.10.4 → 0.10.5 per AGENTS.md (will re-bump over develop if #74 lands first).

fiddur and others added 3 commits August 31, 2026 17:32
One render with every query answered canned: the diff and its changed
line, the anchored finding, the general-comments surface and the
toolbar all have to appear, and an empty working tree has to say so.
jsdom lays nothing out, so the virtualizer gets a fixed 800px world
through the offset sizes it actually reads. The stale pnpm-lock.yaml
that sat in packages/ui goes — the monorepo's lockfile is npm's.

Closes #48

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
…e dialect

Offset accessors are spied, not redefined, so teardown restores jsdom's
own getters. Unstubbed paths 404 with their name so a new surface must
extend the fixture. The thread comes from the wire helpers, the mock
honors the hook's ready contract, and the orphan fallback being empty
pins that the thread really anchored. Bumped to 0.10.6 over merged
develop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
@fiddur
fiddur marked this pull request as ready for review September 1, 2026 12:07
@fiddur
fiddur merged commit df70f3f into develop Sep 1, 2026
2 checks passed
@fiddur
fiddur deleted the diff-page-smoke branch September 1, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DiffPage has no render test

1 participant